package web.tcc.ifrn.janine.utilitarios;

import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpSession;

import web.tcc.ifrn.janine.managedBeans.ContextoBean;

public class ContextoUtil {

	public static ContextoBean getContextBean() {
		FacesContext context = FacesContext.getCurrentInstance();
		ExternalContext externalContext = context.getExternalContext();
		HttpSession session = (HttpSession) externalContext.getSession(true);
		ContextoBean contextoBean = (ContextoBean) session
				.getAttribute("contextoBean");
		return contextoBean;

	}

	public static void removeSessao(String sessao) {
		FacesContext.getCurrentInstance().getExternalContext().getSessionMap()
				.remove(sessao);
	}

}
